import request from '@/utils/request'
import Qs from 'qs'

/**
 * 查询登录历史
 */
export function list(data) {
    return request({
        url: '/sys/loginRecord/list',
        method: 'get',
        params: data
    })
}

/**
 * 删除登录历史
 * @param {array} data 登录历史id
 */
 export function deleteByIds(data) {
    return request({
      url: '/sys/loginRecord/deleteByIds',
      method: 'delete',
      params: {
        loginRecordIds: data
      },
      paramsSerializer: params => {
        return Qs.stringify(params, { indices: false })
      }
    })
  }

  /**
 * 清空登录历史
 */
export function clear() {
    return request({
      url: '/sys/loginRecord/clear',
      method: 'delete'
    })
  }